package com.jbp.utils;

import java.util.Random;

public class RobNameUtil {

    static String[] arrayFirst = {"快乐的",
            "阳光的",
            "微笑的",
            "星空的",
            "晨曦的",
            "清风的",
            "流云的",
            "明月的",
            "柔软的",
            "灿烂的",
            "温柔的",
            "可爱的",
            "甜心的",
            "酷帅的",
            "潇洒的",
            "时尚的",
            "浪漫的",
            "梦想的",
            "青春的",
            "活力的"};

    static String[] arraySecond = {"小猫",
            "小狗",
            "小兔",
            "小鹿",
            "小熊",
            "小鸟",
            "小鱼",
            "小虎",
            "小狮",
            "小象",
            "精灵",
            "天使",
            "宝贝",
            "公主",
            "王子",
            "勇士",
            "骑士",
            "仙女",
            "少年",
            "少女"};

    static char[] letters = {
            'A', 'a', 'B', 'b', 'C', 'c', 'D', 'd', 'E', 'e', 'F', 'f', 'G', 'g',
            'H', 'h', 'I', 'i', 'J', 'j', 'K', 'k', 'L', 'l', 'M', 'm', 'N', 'n',
            'O', 'o', 'P', 'p', 'Q', 'q', 'R', 'r', 'S', 's', 'T', 't', 'U', 'u',
            'V', 'v', 'W', 'w', 'X', 'x', 'Y', 'y', 'Z', 'z'
    };



    public static String getRobName() {
        Random rand = new Random();//生成随机数
        int indexFirst = rand.nextInt(arrayFirst.length);
        String first = arrayFirst[indexFirst];
        int indexSecond = rand.nextInt(arraySecond.length);
        String second = arraySecond[indexSecond];
        String last = first + second;
        for (int i=0; i<3;i++){
            int index = rand.nextInt(letters.length); // 随机索引
            char randomLetter = letters[index];
            last = last + randomLetter;

        }
        return last;
    }
}
